<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFlowStateTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('flowState', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('flow_id')->comment('工作流程id');
            $table->integer('process_id')->comment('过程id');
            $table->integer('conclusion_id')->comment('结果id');
            $table->integer('reason_id')->comment('原因id');
            $table->tinyInteger('status')->default(0)->comment('1:通过,2:未通过');
            $table->integer('next_process_id')->default(0)->comment('进入下一步骤id');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
            
        });
        DB::statement("ALTER TABLE `flowState` comment '工作流当前流程状态表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('flowState');
    }
}
